package com.asset.inventory.kt

import android.content.Context
import android.content.SharedPreferences

/**
 *    @author : sibb
 *    date   : 21-4-2
 *    desc   : 缓存工具类
 */

fun Context.getPreferences(): SharedPreferences = getSharedPreferences("Cache",Context.MODE_PRIVATE)

fun SharedPreferences.open(block: SharedPreferences.Editor.() -> Unit){
    val editor = edit();
    editor.block()
    editor.apply()
}

